//----------------------------------------------------------
// HUD_Game.h
//  Game-specific declaration of abstract HUD class
// 
//----------------------------------------------------------

#ifndef _HUD_GAME_H_
#define _HUD_GAME_H_

#include "HUD.h"
#include "Timer.h"
//#include <string>

class HUD_Game : public HUD
{
private:
	Engine* _engine;
	LPDIRECT3DDEVICE9 _pD3DDevice;
	gamemode_t _gamemode;

	// variables
	//float _timer;			// in-game countdown timer in ms
	Timer* _pTimer;
	bool _timerShow;		// display timer on HUD
	float _fpsTimer;		// timer to slow displayed FPS update
	float _fps;				// fps to display

	// chars for display
	char _cTimer[256];		// text value of timer
	char _cFPS[10];	// text value of FPS
	//std::string _strTimer;

	// rects
	RECT _rTimer;	// timer area
	RECT _rScore;	// score area
	RECT _rFPS;		// FPS area
	RECT _rMisses;	// misses left area

public:
	HUD_Game();
	~HUD_Game();

	// housekeeping
	bool Initialize(LPDIRECT3DDEVICE9 pD3DDevice, Engine* pEngine, gamemode_t eMode);
	bool Shutdown();

	// font object creation / display
	bool InitFonts();
	void CreateRects();
	void DisplayText();

	// texture creation / display
	bool InitTextures();
	void DisplayTextures();

	// timers
	//bool timerOn() { return _timerOn; }
	void ShowTimer(bool timerShow);			// creates the Timer
	Timer* Countdown() { return _pTimer; }	// provide access to the Timer
	//void ResetTimer(float newTime) { _timer = newTime; }
	
	float GetFPSTime() { return _fpsTimer; }
	void UpdateFPSTime(float fpsTime) { _fpsTimer += fpsTime; }
	void ResetFPSTime() { _fpsTimer = 0.0f; }

	gamemode_t GetGameMode() { return _gamemode; }

	// fonts
	LPD3DXFONT pFontTimer;
	LPD3DXFONT pFontFPS;

	// sprite
	LPD3DXSPRITE pSprite;

	// textures
	LPDIRECT3DTEXTURE9 pTexMisses;

};

#endif